<div id="pageInfo" data-title="短消息"></div>
<section class="complain_list">
	<ul>
		{set:$queryMessageList = Api::run('getUcenterMessageList')}
		{foreach:items = $queryMessageList->find()}
		<li onclick='show_msg({$item['id']})'>
			<time>{$item['time']}</time>
			<i id="msg_id_{$item['id']}">
				{if:$queryMessageList->msg->is_read($item['id'])}已读{else:}未读{/if}
			</i>
			<u><strong>{$item['title']}</strong></u>
		</li>
		{/foreach}
	</ul>
	{$queryMessageList->getPageBar()}
</section>

{if:!$items}
<section class="no_tip">您当前没有短消息</section>
{/if}

<script>
function show_msg(id)
{
    $.getJSON("{url:/ucenter/message_read}",{"id":id},function(json)
    {
	    if(json.status == 'success')
	    {
	    	$("#msg_id_"+id).html('已读');
	    	art.dialog({'content':json.data.content,'title':json.data.title,ok:function(){return true;}});
	    }
	    else
	    {
	        alert(json.error);
	    }
    });
}
$(function(){
	// 隐藏底部导航
	hideNav();
});
</script>
